home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HTBasic 9.3
/
HTBasic 9.3.iso
/
83win
/
data1.cab
/
Basic_Plus_Examples
/
STRPWDGT
< prev
next >
Wrap
Text File
|
2001-03-02
|
2KB
|
52 lines
10 ! ************************************************************
20 ! Example: STRIPCHART Widget
30 !
40 ! This program builds a scrolling STRIPCHART widget
50 ! that displays three triangular waveforms.
60 !
70 ! ************************************************************
80 !
90 DIM Nval(1:3)
100 ASSIGN @Stp TO WIDGET "STRIPCHART"
110 CONTROL @Stp;SET ("X":50,"Y":25,"WIDTH":450,"HEIGHT":300)
120 CONTROL @Stp;SET ("TITLE":" Example: STRIPCHART Widget")
130 CONTROL @Stp;SET ("SYSTEM MENU":"Quit")
140 ON EVENT @Stp,"SYSTEM MENU" GOTO Finis
150 !
160 ! Set three traces, scroll 1/10th of display, update all traces in parallel
170 !
180 CONTROL @Stp;SET ("TRACE COUNT":3,"MINIMUM SCROLL":10,"SHARED X":1)
190 !
200 ! Set X-axis and Y-axis origin, range, and labeling
210 !
220 CONTROL @Stp;SET ("CURRENT AXIS":"Y")
230 CONTROL @Stp;SET ("ORIGIN":-4,"RANGE":8,"AXIS LABEL":" Y-Axis Information")
240 CONTROL @Stp;SET ("CURRENT AXIS":"X")
250 CONTROL @Stp;SET ("ORIGIN":0,"RANGE":10,"AXIS LABEL":"X-Axis Information")
260 !
270 ! Set three traces and set POINT CAPACITY = 0 (do not save data)
280 !
290 CONTROL @Stp;SET ("CURRENT TRACE":1)
300 CONTROL @Stp;SET ("TRACE PEN":1,"TRACE LABEL":"Trace 1")
310 CONTROL @Stp;SET ("CURRENT TRACE":2)
320 CONTROL @Stp;SET ("TRACE PEN":2,"TRACE LABEL":"Trace 2")
330 CONTROL @Stp;SET ("CURRENT TRACE":3)
340 CONTROL @Stp;SET ("TRACE PEN":3,"TRACE LABEL":"Trace 3")
350 CONTROL @Stp;SET ("CURRENT TRACE":0,"POINT CAPACITY":0)
360 !
370 ! Display a pattern of triangle waves
380 !
390 DATA 1,-1,3
400 READ Nval(*)
410 FOR N=0 TO 1000
420 WAIT 1
430 CONTROL @Stp;SET ("POINT LOCATION":N,"VALUES":Nval(*))
440 Nval(1)=-Nval(1)
450 Nval(2)=-Nval(2)
460 Nval(3)=-Nval(3)
470 NEXT N
480 !
490 Finis:!
500 ASSIGN @Stp TO * ! Delete STRIPCHART widget
510 END